<!DOCTYPE html>
<html class="x-admin-sm">

<head>
    <meta charset="UTF-8">
    <title>考核申请</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi"/>
    <link rel="stylesheet" href="../css/font.css">
    <link rel="stylesheet" href="../css/iconfont.css">
    <link rel="stylesheet" href="../lib/layui/css/layui.css" media="all">

    <link rel="stylesheet" href="../css/xadmin.css">
    <script src="../lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="../js/xadmin.js"></script>
    <script src="../js/base.js"></script>
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <style>
        tr td,
        tr th {
            text-align: center !important;
            border: none !important;
        }


        .shaixuan .layui-col-md12 .layui-inline {
            margin: 0;
        }

        .shaixuan .layui-col-md12 .layui-inline.layui-col-md4 .layui-form-label {
            width: 30%;
            padding-left: 0;
        }

        .shaixuan .layui-col-md12 .layui-inline.layui-col-md4 .layui-input-inline {
            width: 53%;
        }

        .shaixuan .layui-col-md12 .layui-inline.layui-col-md4 {
            margin-bottom: 20px;
        }

        .shaixuan .layui-col-md12 .layui-inline.layui-col-md3 .layui-form-label {
            width: 30%;
            padding-left: 0;
        }

        .shaixuan .layui-col-md12 .layui-inline.layui-col-md3 .layui-input-inline {
            width: 90%;
        }

        .shaixuan .layui-col-md12 .layui-inline.layui-col-md3 {
            margin-bottom: 20px;
        }

        .shaixuan .layui-col-md12 .layui-inline.layui-col-md6 .layui-form-label {
            width: 30%;
            padding-left: 0;
        }

        .shaixuan .layui-col-md12 .layui-inline.layui-col-md6 .layui-input-inline {
            width: 53%;
        }

        .shaixuan .layui-col-md12 .layui-inline.layui-col-md6 {
            margin-bottom: 20px;
        }

        .layui-col-md24 {
            width: 20%;
            float: left;
        }

        .layui-icon.layui-icon-close {
            font-size: 16px;
            font-weight: 700;
            cursor: pointer;
            right: 5px;
        }
    </style>
</head>

<body>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card" style="display: flex;justify-content: space-between;">
                <div class="layui-card-body ">
                    <blockquote class="layui-elem-quote" style="border:0;font-size: 18px;color: #000;">教练员注册
                    </blockquote>
                </div>
            </div>
        </div>

        <div class="layui-col-md12 shaixuan">
            <div class="layui-card">
                <div class="layui-fluid">
                    <div style="text-align: center;font-size: 16px;margin-bottom: 10px;">基本信息</div>
                    <div class="layui-row layui-col-space15">
                        <div class="layui-col-md10">
                            <div class="layui-card-body " style="display: flex;justify-content:space-between">
                                <form class="layui-form" action="" style="width: 100%;">
                                    <div class="layui-form-item layui-col-md12">
                                        <div class="layui-inline layui-col-md4">
                                            <label class="layui-form-label"><span class="x-red">*</span>姓名：</label>
                                            <div class="layui-input-inline">
                                                <input type="text" name="name" id="name" lay-verify="required"
                                                       autocomplete="off" class="layui-input">
                                            </div>
                                        </div>
                                        <div class="layui-inline layui-col-md4">
                                            <label class="layui-form-label"><span class="x-red">*</span>性别：</label>
                                            <div class="layui-input-inline">
                                                <select id="sex" name="sex" lay-verify="required">
                                                    <option value="1">男</option>
                                                    <option value="2">女</option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="layui-inline layui-col-md4">
                                            <label class="layui-form-label"><span
                                                    class="x-red">*</span>证件类型：</label>
                                            <div class="layui-input-inline">
                                                <select id="documentType" name="documentType" lay-verify="required">
                                                    <option value="1">身份证</option>
                                                    <option value="2">护照</option>
                                                    <option value="3">户口本</option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="layui-inline layui-col-md4">
                                            <label class="layui-form-label"><span
                                                    class="x-red">*</span>证件号码：</label>
                                            <div class="layui-input-inline">
                                                <input type="text" name="documentNumber" id="documentNumber"
                                                       lay-verify="required" autocomplete="off" class="layui-input">
                                            </div>
                                        </div>
                                        <div class="layui-inline layui-col-md4">
                                            <label class="layui-form-label"><span class="x-red">*</span>身高：</label>
                                            <div class="layui-input-inline">
                                                <input maxlength="5" id="height" type="text" name="height"
                                                       lay-verify="required" autocomplete="off" class="layui-input">
                                            </div>
                                        </div>
                                        <div class="layui-inline layui-col-md4">
                                            <label class="layui-form-label"><span class="x-red">*</span>体重：</label>
                                            <div class="layui-input-inline">
                                                <input maxlength="5" type="text" id="weight" name="weight"
                                                       lay-verify="required" autocomplete="off" class="layui-input">
                                            </div>
                                        </div>
                                        <div class="layui-inline layui-col-md4">
                                            <label class="layui-form-label"><span class="x-red">*</span>血型：</label>
                                            <div class="layui-input-inline">
                                                <select id="bloodType" name="bloodType" lay-verify="required">
                                                    <option value="1">A</option>
                                                    <option value="2">B</option>
                                                    <option value="3">AB</option>
                                                    <option value="4">O</option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="layui-inline layui-col-md4">
                                            <label class="layui-form-label"><span class="x-red">*</span>国籍：</label>
                                            <div class="layui-input-inline">
                                                <input id="nationality" type="text" name="nationality"
                                                       lay-verify="required" autocomplete="off" class="layui-input">
                                            </div>
                                        </div>
                                        <div class="layui-inline layui-col-md4">
                                            <label class="layui-form-label"><span class="x-red">*</span>民族：</label>
                                            <div class="layui-input-inline">
                                                <select id="nation" name="nation" lay-verify="required" lay-search>
                                                    <option value="">请选择</option>
                                                    <option value="汉族">汉族</option>
                                                    <option value="阿昌族">阿昌族</option>
                                                    <option value="白族">白族</option>
                                                    <option value="保安族">保安族</option>
                                                    <option value="布朗族">布朗族</option>
                                                    <option value="布依族">布依族</option>
                                                    <option value="朝鲜族">朝鲜族</option>
                                                    <option value="达斡尔族">达斡尔族</option>
                                                    <option value="傣族">傣族</option>
                                                    <option value="德昂族">德昂族</option>
                                                    <option value="侗族">侗族</option>
                                                    <option value="东乡族">东乡族</option>
                                                    <option value="独龙族">独龙族</option>
                                                    <option value="鄂伦春族">鄂伦春族</option>
                                                    <option value="俄罗斯族">俄罗斯族</option>
                                                    <option value="鄂温克族">鄂温克族</option>
                                                    <option value="高山族">高山族</option>
                                                    <option value="仡佬族">仡佬族</option>
                                                    <option value="哈尼族">哈尼族</option>
                                                    <option value="哈萨克族">哈萨克族</option>
                                                    <option value="赫哲族">赫哲族</option>
                                                    <option value="回族">回族</option>
                                                    <option value="基诺族">基诺族</option>
                                                    <option value="京族">京族</option>
                                                    <option value="景颇族">景颇族</option>
                                                    <option value="柯尔克孜族">柯尔克孜族</option>
                                                    <option value="拉祜族">拉祜族</option>
                                                    <option value="黎族">黎族</option>
                                                    <option value="傈僳族">傈僳族</option>
                                                    <option value="珞巴族">珞巴族</option>
                                                    <option value="满族">满族</option>
                                                    <option value="毛南族">毛南族</option>
                                                    <option value="门巴族">门巴族</option>
                                                    <option value="蒙古族">蒙古族</option>
                                                    <option value="苗族">苗族</option>
                                                    <option value="仫佬族">仫佬族</option>
                                                    <option value="纳西族">纳西族</option>
                                                    <option value="怒族">怒族</option>
                                                    <option value="普米族">普米族</option>
                                                    <option value="羌族">羌族</option>
                                                    <option value="撒拉族">撒拉族</option>
                                                    <option value="畲族">畲族</option>
                                                    <option value="水族">水族</option>
                                                    <option value="塔吉克族">塔吉克族</option>
                                                    <option value="塔塔尔族">塔塔尔族</option>
                                                    <option value="土族">土族</option>
                                                    <option value="土家族">土家族</option>
                                                    <option value="佤族">佤族</option>
                                                    <option value="锡伯族">锡伯族</option>
                                                    <option value="乌兹别克族">乌兹别克族</option>
                                                    <option value="瑶族">瑶族</option>
                                                    <option value="彝族">彝族</option>
                                                    <option value="裕固族">裕固族</option>
                                                    <option value="维吾尔族">维吾尔族</option>
                                                    <option value="壮族">壮族</option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="layui-inline layui-col-md4">
                                            <label class="layui-form-label"><span
                                                    class="x-red">*</span>所属协会：</label>
                                            <div class="layui-input-inline">
                                                <select id="associationId" name="associationId"
                                                        lay-verify="required">
                                                    <option value="0">请选择</option>

                                                </select>
                                            </div>
                                        </div>
                                        <div class="layui-inline layui-col-md4">
                                            <label class="layui-form-label"><span
                                                    class="x-red">*</span>教练员等级：</label>
                                            <div class="layui-input-inline">
                                                <select id="coachLevel" name="coachLevel" lay-verify="required">
                                                    <option value="">请选择</option>
                                                    <option value="1">D级</option>
                                                    <option value="2">C级</option>
                                                    <option value="3">B级</option>
                                                    <option value="4">A级</option>
                                                    <option value="5">职业级（PRO）</option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="layui-inline layui-col-md4">
                                            <label class="layui-form-label"><span class="x-red">*</span>市级：</label>
                                            <div class="layui-input-inline">
                                                <select id="city" name="city" lay-verify="required">
                                                    <option value="">全部</option>

                                                </select>
                                            </div>
                                        </div>
                                        <div class="layui-inline layui-col-md4">
                                            <label class="layui-form-label"><span class="x-red">*</span>年份：</label>
                                            <div class="layui-input-inline">
                                                <input type="text" name="year" id="year" lay-verify="date"
                                                       autocomplete="off" class="layui-input">
                                            </div>
                                        </div>
                                        <div class="layui-inline layui-col-md4">
                                            <label class="layui-form-label"><span class="x-red">*</span>出生地：</label>
                                            <div class="layui-input-inline">
                                                <input type="text" id="birthAddress" name="birthAddress"
                                                       lay-verify="required" autocomplete="off" class="layui-input">
                                            </div>
                                        </div>
                                        <div class="layui-inline layui-col-md4">
                                            <label class="layui-form-label"><span
                                                    class="x-red">*</span>出生日期：</label>
                                            <div class="layui-input-inline">
                                                <input type="text" name="birthDay" id="birthDay" lay-verify="date"
                                                       autocomplete="off" class="layui-input">
                                            </div>
                                        </div>
                                        <div class="layui-inline layui-col-md4">
                                            <label class="layui-form-label"><span
                                                    class="x-red">*</span>政治面貌：</label>
                                            <div class="layui-input-inline">
                                                <select id="politicCountenance" name="politicCountenance"
                                                        lay-verify="required">
                                                    <option value="1">党员</option>
                                                    <option value="2">共青团员</option>
                                                    <option value="3">群众</option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="layui-inline layui-col-md4">
                                            <label class="layui-form-label">电子邮箱：</label>
                                            <div class="layui-input-inline">
                                                <input type="text" id="email" name="email" lay-verify="required"
                                                       autocomplete="off" class="layui-input">
                                            </div>
                                        </div>
                                        <div class="layui-inline layui-col-md4">
                                            <label class="layui-form-label"><span class="x-red">*</span>手机号：</label>
                                            <div class="layui-input-inline">
                                                <input type="text" id="tel" name="tel" lay-verify="required"
                                                       autocomplete="off" class="layui-input" readonly>
                                            </div>
                                        </div>
                                        <div class="layui-inline layui-col-md4">
                                            <label class="layui-form-label">其他电话：</label>
                                            <div class="layui-input-inline">
                                                <input type="text" id="otherTel" name="otherTel"
                                                       lay-verify="required" autocomplete="off" class="layui-input">
                                            </div>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                        <div class="layui-col-md2">
                            <div style="border: 1px solid #ccc;width: 115px;height: 137px;">
                                <img id="updateHeadImg" src="" alt=""
                                     style="width:100%;height:100%;position:relative;top:50%;left:50%;margin-top:-69px;margin-left:-58px">
                            </div>
                            <button type="button" class="layui-btn" id="uploadHeadImg"
                                    style="width: 114px;height: 33px;border-radius:5px;margin-top: 15px;margin-left: 2px;">
                                上传图片
                            </button>
                            <div style="width: 114px;margin-top: 10px;">只能上传gif/jpg/png/bmp文件，且不超过5M</div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-card">
                <div class="layui-fluid">
                    <div style="text-align: center;font-size: 16px;margin-bottom: 10px;">单位信息</div>
                    <div class="layui-row layui-col-space15">
                        <div class="layui-col-md12">
                            <div class="layui-card-body " style="display: flex;justify-content:space-between">
                                <form class="layui-form" action="" style="width: 100%;">
                                    <div class="layui-form-item layui-col-md12">
                                        <div class="layui-inline layui-col-md4">
                                            <label class="layui-form-label"><span
                                                    class="x-red">*</span>毕业院校：</label>
                                            <div class="layui-input-inline">
                                                <input type="text" name="graduateSchool" id="graduateSchool"
                                                       lay-verify="required" autocomplete="off" class="layui-input">
                                            </div>
                                        </div>
                                        <div class="layui-inline layui-col-md4">
                                            <label class="layui-form-label"><span
                                                    class="x-red">*</span>主修专业：</label>
                                            <div class="layui-input-inline">
                                                <input type="text" name="major" id="major" lay-verify="required"
                                                       autocomplete="off" class="layui-input">
                                            </div>
                                        </div>
                                        <div class="layui-inline layui-col-md4">
                                            <label class="layui-form-label"><span
                                                    class="x-red">*</span>最高学历：</label>
                                            <div class="layui-input-inline">
                                                <select id="heightEducation" name="heightEducation"
                                                        lay-verify="required">
                                                    <option value="">请选择</option>
                                                    <option value="大学大专">大学大专</option>
                                                    <option value="大学本科">大学本科</option>
                                                    <option value="硕士研究生">硕士研究生</option>
                                                    <option value="博士研究生">博士研究生</option>
                                                </select>
                                            </div>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-card">
                <div class="layui-fluid">
                    <div style="text-align: center;font-size: 16px;margin-bottom: 10px;">合同信息</div>
                    <div class="layui-row layui-col-space15">
                        <div class="layui-col-md12">
                            <div class="layui-card-body " style="display: flex;justify-content:space-between">
                                <form class="layui-form" action="" style="width: 100%;">
                                    <div class="layui-form-item layui-col-md12">
                                        <div class="layui-inline layui-col-md4">
                                            <label class="layui-form-label"><span
                                                    class="x-red">*</span>是否有合同：</label>
                                            <div class="layui-inline">
                                                <input type="radio" name="isContract" value="1" title="有"
                                                       lay-filter="isContract">
                                            </div>
                                            <div class="layui-inline">
                                                <input type="radio" name="isContract" value="2" title="无"
                                                       lay-filter="isContract">
                                            </div>
                                        </div>
                                        <div class="layui-inline layui-col-md12" id="isContract"
                                             style="display:none">
                                            <div class="layui-inline layui-col-md4">
                                                <label class="layui-form-label"><span
                                                        class="x-red">*</span>甲方：</label>
                                                <div class="layui-input-inline">
                                                    <input type="text" name="aParty" id="aParty"
                                                           lay-verify="required" autocomplete="off"
                                                           class="layui-input">
                                                </div>
                                            </div>
                                            <div class="layui-inline layui-col-md4">
                                                <label class="layui-form-label"><span
                                                        class="x-red">*</span>乙方：</label>
                                                <div class="layui-input-inline">
                                                    <input type="text" name="bParty" id="bParty"
                                                           lay-verify="required" autocomplete="off"
                                                           class="layui-input">
                                                </div>
                                            </div>
                                            <div class="layui-inline layui-col-md4">
                                                <label class="layui-form-label"><span
                                                        class="x-red">*</span>签约时间：</label>
                                                <div class="layui-input-inline">
                                                    <input type="text" name="contractTime" id="contractTime"
                                                           lay-verify="required" autocomplete="off"
                                                           class="layui-input">
                                                </div>
                                            </div>
                                            <div class="layui-inline layui-col-md4">
                                                <label class="layui-form-label"><span
                                                        class="x-red">*</span>合同照片：</label>
                                                <div class="layui-input-inline">
                                                    <button type="button" class="layui-btn"
                                                            style="width: 114px;height: 33px;border-radius:5px;margin-left: 2px;"
                                                            id="uploadHetong">上传图片
                                                    </button>
                                                    （限五张）
                                                </div>
                                            </div>
                                            <div class="layui-inline layui-col-md8" id="imgRongqi">

                                            </div>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-card">
                <div class="layui-fluid">
                    <div style="text-align: center;font-size: 16px;margin-bottom: 10px;">体检证明</div>
                    <div class="layui-row layui-col-space15">
                        <div class="layui-col-md12">
                            <div class="layui-card-body " style="display: flex;justify-content:space-between">
                                <form class="layui-form" action="" style="width: 100%;">
                                    <div class="layui-form-item layui-col-md12">
                                        <div class="layui-inline layui-col-md4">
                                            <label class="layui-form-label"><span
                                                    class="x-red">*</span>体检报告：</label>
                                            <div class="layui-input-inline">
                                                <div
                                                        style="width: 118px;height: 138px; margin-top: -20px;margin-bottom: 10px;border: 1px solid #ccc;">
                                                    <img id="updateTijian" src="" style="width: 100%;height: 100%;"
                                                         alt="">
                                                </div>
                                                <button type="button" class="layui-btn"
                                                        style="width: 114px;height: 33px;border-radius:5px;margin-left: 2px;"
                                                        id="uploadTijian">上传图片
                                                </button>
                                            </div>
                                        </div>
                                        <div class="layui-inline layui-col-md4">
                                            <label class="layui-form-label"><span
                                                    class="x-red">*</span>体检时间：</label>
                                            <div class="layui-input-inline">
                                                <input type="text" name="medicalReportDate" id="medicalReportDate"
                                                       lay-verify="required" autocomplete="off" class="layui-input">
                                            </div>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!--            <div class="layui-card">-->
            <!--                <div class="layui-fluid">-->
            <!--                    <div style="text-align: center;font-size: 16px;margin-bottom: 10px;">银行信息</div>-->
            <!--                    <div class="layui-row layui-col-space15">-->
            <!--                        <div class="layui-col-md12">-->
            <!--                            <div class="layui-card-body " style="display: flex;justify-content:space-between">-->
            <!--                                <form class="layui-form" action="" style="width: 100%;">-->
            <!--                                    <div class="layui-form-item layui-col-md12">-->
            <!--                                        <div class="layui-inline layui-col-md6">-->
            <!--                                            <label class="layui-form-label">中信银行卡号：</label>-->
            <!--                                            <div class="layui-input-inline">-->
            <!--                                                <input type="text" name="bankCardNum" id="bankCardNumA"-->
            <!--                                                       lay-verify="required" autocomplete="off" class="layui-input">-->
            <!--                                            </div>-->
            <!--                                        </div>-->
            <!--                                        <div class="layui-inline layui-col-md6">-->
            <!--                                            <label class="layui-form-label">中信银行开户行：</label>-->
            <!--                                            <div class="layui-input-inline">-->
            <!--                                                <input type="text" name="openingBank" id="openingBankA"-->
            <!--                                                       lay-verify="required" autocomplete="off" class="layui-input">-->
            <!--                                            </div>-->
            <!--                                        </div>-->
            <!--                                        <div class="layui-inline layui-col-md6">-->
            <!--                                            <label class="layui-form-label">民生银行卡号：</label>-->
            <!--                                            <div class="layui-input-inline">-->
            <!--                                                <input type="text" name="bankCardNum" id="bankCardNumB"-->
            <!--                                                       lay-verify="required" autocomplete="off" class="layui-input">-->
            <!--                                            </div>-->
            <!--                                        </div>-->
            <!--                                        <div class="layui-inline layui-col-md6">-->
            <!--                                            <label class="layui-form-label">民生银行开户行：</label>-->
            <!--                                            <div class="layui-input-inline">-->
            <!--                                                <input type="text" name="openingBank" id="openingBankB"-->
            <!--                                                       lay-verify="required" autocomplete="off" class="layui-input">-->
            <!--                                            </div>-->
            <!--                                        </div>-->
            <!--                                        <div class="layui-inline layui-col-md6">-->
            <!--                                            <label class="layui-form-label">其他银行卡号：</label>-->
            <!--                                            <div class="layui-input-inline">-->
            <!--                                                <input type="text" name="bankCardNum" id="bankCardNumC"-->
            <!--                                                       lay-verify="required" autocomplete="off" class="layui-input">-->
            <!--                                            </div>-->
            <!--                                        </div>-->
            <!--                                        <div class="layui-inline layui-col-md6">-->
            <!--                                            <label class="layui-form-label">其他银行开户行：</label>-->
            <!--                                            <div class="layui-input-inline">-->
            <!--                                                <input type="text" name="openingBank" id="openingBankC"-->
            <!--                                                       lay-verify="required" autocomplete="off" class="layui-input">-->
            <!--                                            </div>-->
            <!--                                        </div>-->
            <!--                                    </div>-->
            <!--                                </form>-->
            <!--                            </div>-->
            <!--                        </div>-->
            <!--                    </div>-->
            <!--                </div>-->
            <!--            </div>-->
            <div class="layui-form-item" style="text-align: center">
                <button type="button" class="layui-btn submit">保存</button>
            </div>
        </div>
    </div>
</div>

</body>

</html>

<script>
    layui.use(['table', 'laydate', 'upload'], function () {
        var table = layui.table;
        var laydate = layui.laydate;
        var upload = layui.upload;
        var form = layui.form;

        var cityList = ["济南市", "青岛市", "聊城市", "德州市", "东营市", "淄博市", "潍坊市", "烟台市", "威海市", "日照市", "临沂市", "枣庄市",
            "济宁市", "泰安市", "滨州市", "菏泽市"
        ]
        for (var i = 0; i < cityList.length; i++) {
            $("#city").append(
                "<option value=\"" + cityList[i] + "\">" + cityList[i] + "</option>"
            )
        }
        $("#city").val($("#city").attr("data-val"))

        laydate.render({ //初始化时间选择
            elem: '#medicalReportDate'
        });
        laydate.render({ //初始化时间选择
            elem: '#year',
            type: "year"
        });
        laydate.render({ //初始化时间选择
            elem: '#birthDay'
        });
        laydate.render({ //初始化时间选择
            elem: '#contractTime'
        });
        form.on('radio(isContract)', function (data) {
            if (data.value == "1") {
                $("#isContract").css("display", "block")
            }
            if (data.value == "2") {
                $("#isContract").css("display", "none")
            }

        });
        //获取协会列表
        $.ajax({
            url: getAssociationList,
            type: "POST",
            // 设置的是请求参数
            data: {},
            // 用于设置响应体的类型 注意 跟 data 参数没关系！！！
            dataType: 'json',
            success: function (res) {
                for (var i = 0; i < res.associationList.length; i++) {
                    $("#associationId").append(
                        "<option value=\"" + res.associationList[i].id + "\">" + res
                            .associationList[i].name + "</option>"
                    )
                }
                $("#associationId").val($("#associationId").attr("data-val"))
                form.render('select'); //刷新select选择框渲染
            }
        })

        $("body").on("click", ".layui-icon-close", function () {
            var keyWord = $(this).next().attr("src");
            $(this).parents('.layui-col-md24').remove();
            console.log(keyWord)
            imgUrlArry.remove(keyWord)
            console.log(imgUrlArry)
        })

        var medicalReportUrl = $("#updateTijian").attr("src");
        var headPhoto = $("#updateHeadImg").attr("src");
        var imgUrlArry = [];
        for (var i = 0; i < $(".updateHetong").length; i++) {
            imgUrlArry.push($(".updateHetong").eq(i).attr("src"))
        }
        console.log(imgUrlArry)


        //普通图片上传
        //上传头像
        var uploadInst = upload.render({
            elem: '#uploadHeadImg',
            url: uploadTrainerImg,
            exts: 'gif|jpg|png|bmp', //只允许上传后缀
            size: 5120,
            before: function (obj) {
                //预读本地文件示例，不支持ie8
                obj.preview(function (index, file, result) {
                    $('#updateHeadImg').attr('src', result); //图片链接（base64）
                });
            },
            done: function (res) {
                headPhoto = res.url
                console.log(res)
                //如果上传成功
                if (res.msg == '0') {
                    layer.msg("上传成功")
                }
                //上传成功
            },
            error: function () {
                //演示失败状态，并实现重传
                var demoText = $('#demoText');
                demoText.html(
                    '<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-xs demo-reload">重试</a>'
                );
                demoText.find('.demo-reload').on('click', function () {
                    uploadInst.upload();
                });
            }
        });
        //普通图片上传
        //上传体检图片
        var uploadInst = upload.render({
            elem: '#uploadTijian',
            url: uploadTrainerTijianImg,
            exts: 'gif|jpg|png|bmp', //只允许上传后缀
            size: 5120,
            before: function (obj) {
                //预读本地文件示例，不支持ie8
                obj.preview(function (index, file, result) {
                    $('#updateTijian').attr('src', result); //图片链接（base64）
                });
            },
            done: function (res) {
                console.log(res)
                medicalReportUrl = res.url
                //如果上传成功
                if (res.msg == '0') {
                    layer.msg("上传成功")
                }
                //上传成功
            },
            error: function () {
                //演示失败状态，并实现重传
                var demoText = $('#demoText');
                demoText.html(
                    '<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-xs demo-reload">重试</a>'
                );
                demoText.find('.demo-reload').on('click', function () {
                    uploadInst.upload();
                });
            }
        });

        //多图片上传
        upload.render({
            elem: '#uploadHetong',
            url: uploadTrainerHetong,
            multiple: true,
            done: function (res) {
                //上传完毕
                if (imgUrlArry.length < 5) {
                    imgUrlArry.push(res.url);
                    if (res.msg == '0') {
                        layer.msg("上传成功")
                    }
                } else {
                    layer.alert("文件个数超过限制", {
                        title: "提示"
                    });
                    return false
                }
                if ($('#imgRongqi').children().length < 5) {
                    $('#imgRongqi').append(
                        "<div class=\"layui-col-md24\"><div style=\"position:relative;width: 118px;height: 138px; margin-bottom: 10px;border: 1px solid #ccc;\"><i style=\"position:absolute\" class=\"layui-icon layui-icon-close\"></i><img class=\"updateHetong\" style=\"width: 100%;height: 100%;\" src=\"" +
                        res.url + "\"" + "alt=\"\"><\/div><\/div>")
                } else {
                    return false
                }
                console.log(imgUrlArry)
            }
        });


        $(".submit").on("click", function () {
            //表单验证
            var isContract = $("input[name='isContract']:checked").val()
            var coachLevel = $("#coachLevel").val()
            var name = $("#name").val();
            var id = $("#name").attr("data-id");
            var sex = $("#sex").val();
            var documentType = $("#documentType").val();
            var documentNumber = $("#documentNumber").val();
            var height = $("#height").val();
            var weight = $("#weight").val();
            var bloodType = $("#bloodType").val();
            var nationality = $("#nationality").val();
            var nation = $("#nation").val();
            var associationId = $("#associationId").val();
            var year = $("#year").val();
            var birthDay = $("#birthDay").val();
            var birthAddress = $("#birthAddress").val();
            var politicCountenance = $("#politicCountenance").val();
            var tel = $("#tel").val();
            var otherTel = $("#otherTel").val();
            var email = $("#email").val();
            var graduateSchool = $("#graduateSchool").val();
            var major = $("#major").val();
            var heightEducation = $("#heightEducation").val();
            var aParty = $("#aParty").val();
            var bParty = $("#bParty").val();
            var contractTime = $("#contractTime").val();
            var medicalReportDate = $("#medicalReportDate").val();
            // var bankCardNumA = $("#bankCardNumA").val();
            // var openingBankA = $("#openingBankA").val();
            // var bankCardNumB = $("#bankCardNumB").val();
            // var openingBankB = $("#openingBankB").val();
            // var bankCardNumC = $("#bankCardNumC").val();
            // var openingBankC = $("#openingBankC").val();
            var city = $("#city").val();


            console.log(
                id,
                imgUrlArry,
                medicalReportUrl,
                headPhoto,
                name,
                sex,
                documentType,
                documentNumber,
                height,
                weight,
                bloodType,
                nationality,
                nation,
                associationId,
                year,
                birthDay,
                birthAddress,
                politicCountenance,
                tel,
                otherTel,
                email,
                graduateSchool,
                major,
                heightEducation,
                aParty,
                bParty,
                contractTime,
                JSON.stringify(imgUrlArry),
                medicalReportDate,
                // bankCardNumA,
                // openingBankA,
                // bankCardNumB,
                // openingBankB,
                // bankCardNumC,
                // openingBankC,
                city
            )
            if (!/^[\u4e00-\u9fa5]{2,6}$/.test(name) || name == "") {
                layer.alert("请输入2-6位中文姓名", {
                    title: "提示"
                });
                return false
            } else if (!/[0-9a-zA-Z]+/.test(documentNumber) || documentNumber == "") {
                layer.alert("请输入证件号码", {
                    title: "提示"
                });
                return false
            } else if (!/\d\d|\d\d\d/.test(height) || height == "") {
                layer.alert("请输入正确的身高", {
                    title: "提示"
                });
                return false
            } else if (!/\d\d|\d\d\d/.test(weight) || weight == "") {
                layer.alert("请输入正确的体重", {
                    title: "提示"
                });
                return false
            } else if (!/^[\u4e00-\u9fa5]{2,10}$/.test(nation) || nation == "") {
                layer.alert("请输入正确的民族", {
                    title: "提示"
                });
                return false
            } else if (!/^[\u4e00-\u9fa5]{2,10}$/.test(city) || city == "") {
                layer.alert("请输入正确的市级", {
                    title: "提示"
                });
                return false
            } else if (!/^[\u4e00-\u9fa5]{2,15}$/.test(nationality) || nationality == "") {
                layer.alert("请输入正确的国籍", {
                    title: "提示"
                });
                return false
            } else if (associationId == "0") {
                layer.alert("请选择所属协会 ", {
                    title: "提示"
                });
                return false
            } else if (year == "") {
                layer.alert("请选择年份 ", {
                    title: "提示"
                });
                return false
            } else if (!/^[\u4e00-\u9fa5]{2,10}$/.test(birthAddress) || birthAddress == "") {
                layer.alert("请输入正确的出生地 ", {
                    title: "提示"
                });
                return false
            } else if (birthDay == "") {
                layer.alert("请选择出生日期 ", {
                    title: "提示"
                });
                return false
            } else if (!(/^1[3456789]\d{9}$/.test(tel))) {
                layer.alert("请输入正确的手机号", {
                    title: "提示"
                });
                return false
            } else if (!/^[\u4e00-\u9fa5]{4,12}$/.test(graduateSchool) || graduateSchool == "") {
                layer.alert("请输入正确的毕业院校", {
                    title: "提示"
                });
                return false
            } else if (!/^[\u4e00-\u9fa5]{2,12}$/.test(major) || major == "") {
                layer.alert("请输入正确的主修专业", {
                    title: "提示"
                });
                return false
            } else if (heightEducation == "") {
                layer.alert("请选择最高学历", {
                    title: "提示"
                });
                return false
            } else if (isContract == "" || isContract == undefined) {
                layer.alert("请选择是否有合同", {
                    title: "提示"
                });
                return false
            } else if (isContract == "2") {
                aParty = "";
                bParty = "";
                contractTime = "";
                imgUrlArry = [];
            } else if (isContract == "1" && aParty == "") {
                layer.alert("请输入甲方名称", {
                    title: "提示"
                });
                return false
            } else if (isContract == "1" && bParty == "") {
                layer.alert("请输入乙方名称", {
                    title: "提示"
                });
                return false
            } else if (isContract == "1" && contractTime == "") {
                layer.alert("请选择合同时间", {
                    title: "提示"
                });
                return false
            } else if (isContract == "1" && imgUrlArry.length == 0) {
                layer.alert("请上传合同照片", {
                    title: "提示"
                });
                return false
            } else if (medicalReportDate == "") {
                layer.alert("请选择体检时间", {
                    title: "提示"
                });
                return false
            } else if (medicalReportUrl == undefined || medicalReportUrl == "") {
                layer.alert("请添加体检报告", {
                    title: "提示"
                });
                return false
            } else if (headPhoto == undefined || headPhoto == "") {
                layer.alert("请添加头像照片", {
                    title: "提示"
                });
                return false
            }
            $.ajax({ //保存表单
                url: saveTrainerReg,
                type: "POST",
                // 设置的是请求参数
                data: {
                    id: id,
                    medicalReportUrl: medicalReportUrl,
                    headPhoto: headPhoto,
                    isContract: isContract,
                    name: name,
                    sex: sex,
                    coachLevel: coachLevel,
                    documentType: documentType,
                    documentNumber: documentNumber,
                    height: height,
                    weight: weight,
                    bloodType: bloodType,
                    nationality: nationality,
                    nation: nation,
                    associationId: associationId,
                    year: year,
                    birthDay: birthDay,
                    birthAddress: birthAddress,
                    politicCountenance: politicCountenance,
                    tel: tel,
                    otherTel: otherTel,
                    email: email,
                    graduateSchool: graduateSchool,
                    major: major,
                    heightEducation: heightEducation,
                    aParty: aParty,
                    bParty: bParty,
                    contractTime: contractTime,
                    imgUrlArry: JSON.stringify(imgUrlArry),
                    medicalReportDate: medicalReportDate,
                    city: city,
                },
                // 用于设置响应体的类型 注意 跟 data 参数没关系！！！
                dataType: 'json',
                success: function (res) {
                    if (res.msg !== "0") {
                        layer.alert(res.msg, {
                            title: "提示"
                        });
                    } else {
                        layer.alert("修改成功", {
                            title: "提示",
                            cancel: function () {
                                parent.layui.table.reload("testReload");
                                xadmin.close()
                            }
                        }, function () {
                            // window.location.reload()
                            parent.layui.table.reload("testReload");
                            xadmin.close()
                        });
                    }
                }
            })

        })


    });
    //数组操作方法
    Array.prototype.indexOf = function (val) {
        for (var i = 0; i < this.length; i++) {
            if (this[i] == val) return i;
        }
        return -1;
    };
    Array.prototype.remove = function (val) {
        var index = this.indexOf(val);
        if (index > -1) {
            this.splice(index, 1);
        }
    };
</script>